Skip to contentSkip to conversation

GL_AMD_pinned_memory extension causing a kernel hardlock

Bug 89734 [email protected] 1 participant 19 messages Mar 23, 2015 – Apr 8, 2015

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=89734

Bug ID: 89734
Summary: GL_AMD_pinned_memory extension causing a kernel
hardlock
Product: Mesa
Version: git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

Kubuntu 15.04, kernel 4.0rc3, amd hd7850 with recent (from ppa oibaf) open source drivers. Dolphin emulator runs fine except that I have a complete freeze when I exit. I have to reboot the computer (although it seems to be still running as I can remotely log with ssh). I tried under kde, then under icewm, to see if it was the compositor's fault. No change. Windowed or fullscreen:
same freeze. I tried to stop Dolphin with the interface buttons: same freeze.

kubuntu 15.04, i7 4770k non overclocked, amd hd7850 on open source drivers.

dmesg log is here:
http://pastebin.ca/2962286

I reported the bug to the Dolphin team. Told me that "Basically it's AMD's GL_AMD_pinned_memory extension causing a kernel hardlock." and that I have to report here.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=89734

Michel Dänzer <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

          Component|Drivers/Gallium/radeonsi    |DRM/Radeon
            Version|git                         |unspecified
            Product|Mesa                        |DRI
         QA Contact|[email protected] |
                   |.org                        |

--- Comment #1 from Michel Dänzer <[email protected]> --- Please attach the dmesg output here directly.

Christian, any ideas?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

Christian König <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Christian König <[email protected]> --- (In reply to Michel Dänzer from comment #1)

Quoted 3 lines

Please attach the dmesg output here directly.

Christian, any ideas?

Not of hand. Looks like we don't handle something correctly on tearing this down, but I'm not sure what it is.

Going to take a look at it.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #3 from Christian König <[email protected]> --- Created attachment 114584
--> https://bugs.freedesktop.org/attachment.cgi?id=114584&action=edit
Debuging patch.

The only possible cause I can come up with is that we try to free the sg table twice.

Please apply the attached debugging patch and report back with the resulting dmesg.

Thanks in advance,
Christian.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #4 from [email protected] ---
Created attachment 114609
--> https://bugs.freedesktop.org/attachment.cgi?id=114609&action=edit
first requested dmesg

Here's the first requested dmesg output.
Applying the attached debugging patch is above my skills, unfortunately. Don't know if you can create a binary so that I can test (or give me a procedure on how to apply the patch).
Sorry for too low technical skills guys.
The dolphin version tested is 5921 (but same pb on older revisions). Freeze happens on the exit of Mario Kart and Donkey Kong Country Wii (I didn't test more as if seems independant of the game).

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #5 from Christian König <[email protected]> --- (In reply to poub365-bugzilla from comment #4)

Quoted 11 lines

Created attachment 114609 [details]
first requested dmesg

Here's the first requested dmesg output.
Applying the attached debugging patch is above my skills, unfortunately. Don't know if you can create a binary so that I can test (or give me a procedure on how to apply the patch).
Sorry for too low technical skills guys.
The dolphin version tested is 5921 (but same pb on older revisions). Freeze happens on the exit of Mario Kart and Donkey Kong Country Wii (I didn't test more as if seems independant of the game).

Unfortunately we usually don't have time to provide binary packages for every small patch we make, sorry.

You could try following one of the tutorials on the net how to compile your own kernel with kbuntu. If you managed to do so applying the patch on top of it is trivial.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #6 from [email protected] ---
Created attachment 114670
--> https://bugs.freedesktop.org/attachment.cgi?id=114670&action=edit
dmesg with patch

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #7 from [email protected] --- This is what I did (main commands)
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-vivid.git

patch -p1 </home/jo/internet/Downloads/mesa/0001-WIP-userptr-debuging-patch.patch

fakeroot debian/rules clean
fakeroot debian/rules binary-headers binary-generic

Installed the new kernel (3.19) and rebooted on it. Same freeze on the exit of Dolphin. Here's the new dmesg log. Hope I did it right.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #8 from Christian König <[email protected]> --- (In reply to poub365-bugzilla from comment #7)

Quoted 2 lines

Installed the new kernel (3.19) and rebooted on it. Same freeze on the exit of Dolphin. Here's the new dmesg log. Hope I did it right.

Yeah, thanks! That's exactly what I needed.

And my initial suspicion was right, for some reason we try to free the SG table twice:

[  141.833287] [drm:radeon_ttm_backend_unbind [radeon]] *ERROR* ttm->sg =
ffff880222930e00, ttm->sg->sgl = ffff8802238bd200
...
[  141.898159] [drm:radeon_ttm_backend_unbind [radeon]] *ERROR* ttm->sg =

ffff880222930e00, ttm->sg->sgl = (null)

Which then obviously causes problems.

For a quick fix we could try to double check if we haven't already freed the table, but I think the underlying problem is that we try to free the BO twice as well.

@Michel any ideas?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #9 from Christian König <[email protected]> --- Created attachment 114727
--> https://bugs.freedesktop.org/attachment.cgi?id=114727&action=edit
Possible fix

Please test the attached patch it should fix your issue for now.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #10 from Michel Dänzer <[email protected]> --- (In reply to Christian König from comment #8)

Quoted 1 line

@Michel any ideas?

I'm afraid not. :(

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #11 from [email protected] ---
Created attachment 114820
--> https://bugs.freedesktop.org/attachment.cgi?id=114820&action=edit
screen flickers with patch

I tried the new patch.
I can exit now without freezing but I have a lot of artifacts (see video) in the game but also on desktop (kde with opengl): the screen flickers a lot. The dmesg will follow.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #12 from [email protected] ---
Created attachment 114821
--> https://bugs.freedesktop.org/attachment.cgi?id=114821&action=edit
dmesg with patch

No idea if that helps, but just in case.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #13 from Michel Dänzer <[email protected]> --- (In reply to poub365-bugzilla from comment #11)

Quoted 2 lines

I can exit now without freezing but I have a lot of artifacts (see video) in the game but also on desktop (kde with opengl): the screen flickers a lot.

Unless setting the environment variable

MESA_EXTENSION_OVERRIDE='-GL_AMD_pinned_memory'

avoids that problem, it's probably a separate issue that needs to be tracked in its own report, including the corresponding Xorg.0.log file.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #14 from [email protected] ---
Created attachment 114841
--> https://bugs.freedesktop.org/attachment.cgi?id=114841&action=edit
xorg with patch

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#15 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #15 from [email protected] ---
Created attachment 114842
--> https://bugs.freedesktop.org/attachment.cgi?id=114842&action=edit
dmesg with patch

Very strange: I booted on the patch kernel today to get a Xlog. No flickering on desktop neither on fullscreen game. I didn't upgrade any component since last time. Dolphin is working fine from my quick test.

So, I can now exit dolphin without freezing. I get this message on the console:

The program 'dolphin-emu' received an X Window System error. This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 8835 error_code 3 request_code 38 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.)
terminate called without an active exception
Abandon (core dumped)

I attach my dmesg and xorg.log just in case.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#16 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #16 from Christian König <[email protected]> --- (In reply to poub365-bugzilla from comment #15)

Quoted 6 lines

Created attachment 114842 [details]
dmesg with patch

Very strange: I booted on the patch kernel today to get a Xlog. No flickering on desktop neither on fullscreen game. I didn't upgrade any component since last time. Dolphin is working fine from my quick test.

Mhm, could be an uninitialized variable or something like this. Not sure off hand. But if it works fine now it's unlikely that this is a driver problem.

Quoted 16 lines

So, I can now exit dolphin without freezing. I get this message on the console:

The program 'dolphin-emu' received an X Window System error. This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 8835 error_code 3 request_code 38 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.)
terminate called without an active exception
Abandon (core dumped)

Quoted 1 line

I attach my dmesg and xorg.log just in case.

That's a completely different issue, not even sure if it is a driver problem at all.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#17 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

--- Comment #17 from Daniel Stone <[email protected]> --- (In reply to Christian König from comment #16)

Quoted 13 lines

(In reply to poub365-bugzilla from comment #15)

Quoted 12 lines

The program 'dolphin-emu' received an X Window System error. This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 8835 error_code 3 request_code 38 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.)
terminate called without an active exception
Abandon (core dumped)

Quoted 4 lines
Quoted 1 line

I attach my dmesg and xorg.log just in case.

That's a completely different issue, not even sure if it is a driver problem at all.

It's not - request #38 is XQueryPointer, which GL drivers don't do.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#18 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=89734

Christian König <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #18 from Christian König <[email protected]> --- In this case we can probably close this bug report, cause the original issue is fixed.

If you find another issue which could be cause by the driver stack feel free to open up a new bug.

Thanks for the help,
Christian.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel